package com.bw.lyc.mvp.view.video.adapter;


import java.util.ArrayList;
import java.util.List;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;

import com.bw.lyc.mvp.view.people.RecommendFragment;
import com.bw.lyc.mvp.view.video.SmallVideoFragment;

public class VideoVpAdapter extends FragmentPagerAdapter {

    private List<Fragment>list;
    private String[]titles={"推荐","小视频"};

    public VideoVpAdapter(@NonNull FragmentManager fm) {
        super(fm);
        list = new ArrayList<>();
        list.add(new RecommendFragment());
        list.add(new SmallVideoFragment());
    }

    @NonNull
    @Override
    public Fragment getItem(int position) {
        return list.get(position);
    }

    @Override
    public int getCount() {
        return list.size();
    }

    @Nullable
    @Override
    public CharSequence getPageTitle(int position) {
        return titles[position];
    }
}
